package com.lpc.databindingtest2;

import android.databinding.BindingConversion;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 功能:
 * <p>
 * 描述:
 * <p>
 * Created by lipc0113 on 2018/7/26.
 */
public class DataBindingConverter {

    @BindingConversion
    public static String conversionInt(int i){

        return String.valueOf(i);
    }

    @BindingConversion
    public static String conversionDate(Date d){

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        return simpleDateFormat.format(d);
    }
}
